<?php
/**
 * Created by PhpStorm.
 * User: 18048
 * Date: 2018/5/14
 * Time: 10:14
 */
$serv = new swoole_server('0.0.0.0',9501,SWOOLE_BASE);

$serv->set(array(
        'reactor_num'=>1,
        'worker_num'=>4,
    )
);

$serv->on('connect',function($serv,$fd){});
$serv->on('receive',function($serv,$fd,$from_id,$data){});
$serv->on('close',function($serv,$fd){});

$serv->start();